package action.OrderAction;

import java.sql.Connection;

import model.dao.MessageDao;
import Tools.DbConnection;

import com.opensymphony.xwork2.ActionSupport;

public class OrderHandler extends ActionSupport {
	DbConnection db=new DbConnection();
	private int message_id;
	private boolean success;
	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public int getMessage_id() {
		return message_id;
	}

	public void setMessage_id(int message_id) {
		this.message_id = message_id;
	}

	public String confirm() throws Exception {
		// TODO Auto-generated method stub
		Connection cn=db.init();
		MessageDao dao=new MessageDao();
		success=dao.confirmOrderDB(cn, message_id);
		cn.close();
		return SUCCESS;
	}

	public String defuse() throws Exception {
		// TODO Auto-generated method stub
		Connection cn=db.init();
		MessageDao dao=new MessageDao();
		success=dao.defuseOrderDB(cn, message_id);
		cn.close();
		return SUCCESS;
	}
}
